<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/12
 * Time: 10:34
 */
class MY_Controller extends CI_Controller
{
    const requestCdn = 'http://mediaty.tv189.com/file_service/?c=requestCdn&m=download';
    const commonUpload = 'zip|gif|png|jpg|jpeg';
    public  $need_login = false;  

    public function __construct()
    {
    	
        parent::__construct();
        $this->check_login();
    }


    public function check_login(){  
    	//$_COOKIE['mercode'];die;
            if($this->need_login){  
                 $cookie_data = $_COOKIE['mercode'] ; 
                if(!$cookie_data){  
                     $url = "?c=user&m=login";    
                echo "<script language='javascript' type='text/javascript'>";    
                echo "window.location.href='$url'";    
                echo "</script>";  
                exit;  
                }  
            }  
              
        } 
     
}
